package com.m4f.fse.components.impl;

import javax.persistence.Id;
import org.apache.wicket.IClusterable;
import com.googlecode.objectify.annotation.Entity;
import com.m4f.fse.components.ifc.SearchEngine;

@Entity
public abstract class BaseSearchEngine implements SearchEngine, Comparable<BaseSearchEngine>, IClusterable  {
	 
	@Id Long id;
	private int priority;
	private String lang;
	
	@Override
	public void setPriority(int p) {
		this.priority = p;
	}
	
	@Override
	public int getPriority() {
		return this.priority;
	}
	
	public void setLang(String l) {
		this.lang = l;
	}
	
	public String getLang() {
		return this.lang;
	}
	
	@Override
	public int compareTo(BaseSearchEngine o) {
		if(this.getPriority() > o.getPriority()) {
			return 1;
		}
		if(this.getPriority() < o.getPriority()) {
			return -1;
		}
		return 0;
	}

}
